﻿var curAdv = new Array();
curAdv[1] = "";
curAdv[1] += "<a href=\"#\" target=\"_blank\">";
curAdv[1] +="<img src=\"../images/adv4.jpg\" border=\"0\"></a>";
curAdv[2] = "";
curAdv[2] += "<a href=\"#\" target=\"_blank\">";
curAdv[2] +="<img src=\"../images/adv5.jpg\" border=\"0\"></a>";
curAdv[3] = "";
curAdv[3] += "<a href=\"#\" target=\"_blank\">";
curAdv[3] +="<img src=\"../images/adv6.jpg\" border=\"0\"></a>";

function getRandom(advLen) {
    var iRandom = 0;
    while (true) {
        if (iRandom < 1) {
            for (var i=0; i<10; i++) {
                iRandom = Math.round(Math.random() * advLen);
            }
        } else {
            break;
        }
    }
    return iRandom;
}

function swapAdvTop() {
    var advTop = document.getElementById("advtop");
    if (advTop != null) {
        var pos = getRandom(curAdv.length-1);
        if (pos >= 0 && pos < curAdv.length)
            advTop.innerHTML = curAdv[pos];
    }
}

var swapTop = setInterval("swapAdvTop()",4000);

swapAdvTop();